<!DOCTYPE html>

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>宠物医院</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <link th:href="@{/img/pet2.jpg}" rel="shortcut icon">
</head>

<body>
<!--顶部导航栏-->
<div th:replace="~{comment/comment::topbar}"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边导航栏-->
        <div th:replace="~{comment/comment::sidebar(active='pet/petInfo.html')}"></div>
        <!--主视图-->
        <main role="main" class="col-md-9 ml-sm-auto col-lg-11 pt-3 px-4">
            <!--表单-->
            <form th:action="@{/updatePet}" method="post">
                <input type="hidden" name="pId" th:value="${pet.getpId()}">
                <div class="form-group">
                    <label>姓名</label>
                    <input type="text" class="form-control" name="pName" th:value="${pet.getpName()}">
                </div>
                <div class="form-group">
                    <label>年龄</label>
                    <input type="text" class="form-control" name="pAge" th:value="${pet.getpAge()}">
                </div>
                <div class="form-group">
                    <label>性别</label><br/>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="radio" name="pSex" value="1" th:checked="${pet.getpSex()==1}">
                        <label class="form-check-label">公</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input" type="radio" name="pSex" value="0" th:checked="${pet.getpSex()==0}">
                        <label class="form-check-label">母</label>
                    </div>
                </div>
                <div class="form-group">
                    <label>病情</label>
                    <input type="text" class="form-control" name="illness" th:value="${pet.getIllness()}">
                </div>
                <div class="form-group">
                    <label>主人</label>
                    <input type="text" class="form-control" name="master" th:value="${pet.getMaster()}">
                </div>
                <div class="form-group">
                    <label>科室</label>
                    <select class="form-control" name="pSickroom">
                        <option th:each="s:${sickrooms}" th:text="${s.getSickroomName()}" th:value="${s.getSickroomName()}"
                                th:selected="${s.getSickroomName()==pet.getpSickroom()}"></option>
                    </select>
                </div>
                <div class="form-group">
                    <label>医生</label>
                    <select class="form-control" name="pDoctor">
                        <option th:each="d:${doctors}" th:text="${d.getdName()}" th:value="${d.getdName()}"
                                th:selected="${d.getdName()==pet.getpDoctor()}"></option>
                    </select>
                </div>
                <div class="row">
                    <div class="col-md-11 column">
                        <button type="submit" class="btn btn-primary">提交修改</button>
                    </div>
                    <div class="col-md-1 column">
                        <a class="btn btn-primary" th:href="@{/getPets}">返回</a>
                    </div>
                </div>
            </form>
        </main>
    </div>
</div>
</body>

</html>